package com.lxc.graduation.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lxc.graduation.dao.CommentMapper;
import com.lxc.graduation.entity.domain.Comment;
import com.lxc.graduation.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: ck
 * @Description:
 * @Date: Create in 23:08 2021/2/1
 */
@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    private CommentMapper commentMapper;

    @Override
    public List<Comment> listByTopicId(Integer topicId) {
        return commentMapper.selectList(new QueryWrapper<Comment>().eq("topic_id",topicId));
    }

    @Override
    public void insert(Comment comment) {
        commentMapper.insert(comment);
    }
}
